<template>
	<view>
		<view class="box2" v-for="item in arrdata">{{item}}</view>
		<view>
			<button type="warn" @click="pulldown">下拉刷新</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				arrdata:["java开发基础","前端讲解","企业级开发框架","java开发基础","前端讲解","企业级开发框架","java开发基础","前端讲解","企业级开发框架"]
			}
		},
		methods: {
			pulldown(){
				uni.startPullDownRefresh()
			}
			
		},
		onPullDownRefresh() {
			console.log("触发了下拉刷新")
			this.arrdata=["数据库原理","移动开发","java开发基础","前端讲解"]
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			console.log("触发了上拉加载行为")
			this.arrdata=[...this.arrdata,...["数据库原理","移动开发","java开发基础"]]
		}
		
	}
</script>

<style>
	.box2{
		height: 80px;
		line-height: 80px;
	}

</style>
